<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/10/16/016
 * Time: 17:44
 */

namespace app\admin\controller;


use app\common\logic\Logic;
use app\common\model\MemberConfig;
use think\Controller;

class Member extends Base
{



    public function index()
    {
        $map = [];

        $model = new MemberConfig();
        $rows = $model->getList($map);
        $this->assign([
            'title' => '会员配置',
            'pageHTML' => $rows->render(),
            'rows' => $rows
        ]);
        return view();
    }

    public function edit()
    {
        if(request()->isPost()){
            $data   = input('post.');
            $model  = new Logic();
            $result = $model->saveChange('member_config',$data,false);
            if($result !== false){
                $this->success('修改成功',url('index'));
            }
            $this->error($model->getError());
        }
        $where['status'] = 1;
        $this->_show('member_config','id');
        $this->assign('title','编辑');
        return view();
    }

    public function change()
    {
        $this->_change('banner');
    }

    public function del()
    {
        $this->_del('banner');
    }


}